public class Euler3 {

public static void main(String args[]){
long num=315784931803;

long num=3;
num*=10; num+=1;
num*=10; num+=7;
num*=10; num+=5;
num*=10; num+=8;
num*=10; num+=4;
num*=10; num+=9;
num*=10; num+=3;
num*=10; num+=1;
num*=10; num+=8;
num*=10; num+=0;
num*=10; num+=3;
long i=2;
for(;  num!=1; i++){
if(num%i==0){num/=i;i--;}
}
System.out.println(i);
}

}